/*! \file Driver.cpp
 *	\brief 
 *
 *	created:	2010/04/05
 *	created:	5:4:2010   21:58
 *	filename: 	c:\src\tactics-engine\libs\gd_dx11\Driver.cpp
 *	file path:	c:\src\tactics-engine\libs\gd_dx11
 *	file base:	Driver
 *	file ext:	cpp
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#include "gd_dx11/stdafx.h"
#include "gd_dx11/Driver.h"

#include <app_win/Window.h>
#include <core/exception.h>

#include "gd_dx11/Device.h"

namespace tt{
namespace gd_dx11{

Driver::Driver(void)
{
}

Driver::~Driver(void)
{
}

SharedPtr<gd::Device> Driver::onCreateDevice(const SharedPtr<app::Window>& window)
{
	SharedPtr<app_win::Window> window_win = dynamic_pointer_cast<app_win::Window>(window);
	if(!window_win)
		ttThrow(TEXT("Window is not descendant of app_win::Window"));
	return SharedPtr<gd::Device>(new Device(this, window_win));;
}

} //namespace gd_dx11
} //namespace tt
